package com.kotasoft.iip.model.insurance;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.eclipse.persistence.annotations.UuidGenerator;

@Entity
@Table(name = "I_CONTRACT")
@UuidGenerator(name = "CONTRACT_ID_GEN")
@SuppressWarnings("serial")
public class Contract implements Serializable {

	@Id
	@Column(name = "ID", length = 36)
	@GeneratedValue(generator = "CONTRACT_ID_GEN")
	protected String id;

	@Column(name = "NUMBER", length = 128, nullable = false)
	private String number;

	@OneToMany(cascade = CascadeType.DETACH, fetch = FetchType.LAZY, mappedBy = "contract")
	private List<Order> orders;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}
}
